package com.example.javatwo.controller.cg.yt;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.example.javatwo.pojo.cg.yt.DsAssignBuyMain;
import com.example.javatwo.pojo.cg.yt.DsDataSet1;
import com.example.javatwo.service.cg.yt.CgftService;

@Controller
@RequestMapping("/cgft/")
public class CgftController {
	
	@Autowired
	private CgftService cgftService;
	
	@RequestMapping("index")
	public Object index(){
		return "cg/yt/cgft";
	}
	
	@ResponseBody
	@RequestMapping("load")
	public Object load(int pageNum){
		System.out.println(pageNum);
		return cgftService.list(pageNum);
	}
	
	@ResponseBody
	@RequestMapping("/add")
	public Object add(@RequestBody DsAssignBuyMain dsDataSet1)throws Exception{
		System.out.println(dsDataSet1);
		cgftService.add(dsDataSet1);
		return "添加成功";
	}
	
	@ResponseBody
	@RequestMapping("/update")
	public void update(@RequestBody DsAssignBuyMain dsDataSet1)throws Exception{
		System.out.println(dsDataSet1);
		cgftService.update(dsDataSet1);
	}
	
	@ResponseBody
	@RequestMapping("/del")
	public void del(@RequestBody String billNo)throws Exception{
		System.out.println(billNo);
		cgftService.del(billNo);
	}
	
	@ResponseBody
	@RequestMapping("/auditing")
	public Object auditing(@RequestBody DsAssignBuyMain dsDataSet1)throws Exception{
		return cgftService.auditing(dsDataSet1);
	}
	
	@ResponseBody
	@RequestMapping("/auditingss1")
	public Object auditing1(@RequestBody DsAssignBuyMain dsDataSet1)throws Exception{
		System.out.println(dsDataSet1);
		return cgftService.auditing1(dsDataSet1); 
	}
}
